home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / QuickDraw GX / QuickDraw GX Info / QuickDraw GX Interfaces / Interfaces & Libraries / interfaces / camera library.h next >
Encoding:
C/C++ Source or Header  |  1994-04-30  |  1.2 KB  |  60 lines  |  [TEXT/MPS ]

  1. /* graphics libraries:
  2.     Perspective mapping generation routines
  3.     by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1993 Apple Computer, Inc.  All rights reserved. */
  5.  
  6. #pragma once
  7. #ifndef cameraLibraryIncludes
  8. #define cameraLibraryIncludes
  9.  
  10.     #include "math types.h"
  11.     
  12.     #ifdef __cplusplus
  13.     extern "C" {
  14.     #endif
  15.  
  16.     struct point3D {
  17.         Fixed    x;
  18.         Fixed    y;
  19.         Fixed    z;
  20.     };
  21.     
  22.     struct unit3D {
  23.         fract        x;
  24.         fract        y;
  25.         fract        z;
  26.     };
  27.     
  28.     struct camera {
  29.         struct point3D        location;
  30.         struct point3D        axis;
  31.         struct point3D        zenith;
  32.         struct point3D        observer;
  33.         gxMapping            orientation;
  34.     };
  35.     
  36.     struct patch {
  37.         struct point3D        u;
  38.         struct point3D        v;
  39.         struct point3D        origin;
  40.     };
  41.     
  42. #ifndef __cplusplus
  43.     typedef struct point3D point3D;
  44.     typedef struct unit3D unit3D;
  45.     typedef struct camera camera;
  46.     typedef struct patch patch;
  47. #endif
  48.  
  49.     void InitCamera(camera *);
  50.     void UpdateCamera(camera *);
  51.     void PatchToCameraMap(patch *, camera *, gxMapping *);
  52.     Fixed Unitize(point3D *, unit3D *);
  53.     fract FracDot(unit3D *, unit3D *);
  54.     void FracCross(unit3D *, unit3D *, unit3D *cross);
  55.  
  56.     #ifdef __cplusplus
  57.     }
  58.     #endif
  59. #endif
  60.